<?php
include("../inc/conn.inc");
//$sql = "select id from catalog_copy where id>35 and cat_id<36";
$sql = "select id from catalog where id>35 and cat_id>35";
$cata_rs2=mysql_query($sql);

while($rs = mysql_fetch_array($cata_rs2))
{
	echo "ID=".$rs['id']."<br>";
	$sql2 = "select count(*) as c from product where p_sh=1 and catalog_id3=$rs[id]";
	$count = mysql_query($sql2);
	$c_row = mysql_fetch_array($count);
	echo "合计:".$c_row['c']."<br>";
	$sql3= "update catalog set p_num=$c_row[c] where id=$rs[id]";
	$save = mysql_query($sql3);
	if($save)$c++;
	echo "修改:".$save."<br>";
	
}

echo "<br>";
echo $c."条";
